What I have tried?
UIScreen.screens.count > 1
Ans : Always getting one even though my app is currently Airplay(ing) on my Macbook
Setting configuration of WKWebView
mediaPlaybackAllowsAirPlay = false
allowsAirPlayForMediaPlayback = false
Although the airplay button is not present in the player controls but one can still caste using the control panel airplay button by swipping the screen from above.
Tried this method used widely to detect Airplay but it only detects in case of screen mirroring no callbacks for Airplay.
func isAirplayOn() -> Bool {
let audioSession = AVAudioSession.sharedInstance()
let currentRoute = audioSession.currentRoute
for outputPort in currentRoute.outputs {
if outputPort.portType == AVAudioSession.Port.airPlay {
return true
}
}
return false
}
So to my vain this also does not work.
Let me know how to either detect airplay or disable it on WKWebView's Audio/Video Player.
Any help will be highly appreciated.
Post
Replies
Boosts
Views
Activity
Can we use .HEIF files instead of .png for App Alternate Icons on iOS Applications?
Also any alternative to use .heif as UIImages on Xcode rather than converting them from Data to Image all the time.